from django.urls import path, include
from rest_framework.routers import DefaultRouter

from app.api import MessageModelViewSet, UserModelViewSet
from app.views import *

router = DefaultRouter()
router.register(r'message', MessageModelViewSet, basename='message-api')
router.register(r'user', UserModelViewSet, basename='user-api')

urlpatterns = [
    path('', index, name='index'),
    path('index2/', index2, name='index2'),
    path('register/', register, name='register'),
    path('login/', user_login, name='login'),
    path('logout/', LogoutView.as_view(next_page='index'), name='logout'),

    path('chat/', chatIndex, name='chatIndex'),
    path(r'api/v1/', include(router.urls)),
]
